<template>
	<view class="pagesDoctorChat">
		<view class="content" v-if="unReadMessageList.length>0">
			<view class="itemBox" v-for="(item,index) in unReadMessageList" :key="index">
				<view>
					<view class="itemBoxOne">
						<text class="itemBoxRight"> 订单id:{{item.orderId}}</text>
						<text class="itemBoxRight"> 病人:{{item.patientsName?item.patientsName:'' }}</text>
						<text class="itemBoxRight itemNoRead "> 未读数:{{item.number}}</text>
					</view>
					<view class="itemBoxOne">
						<text class="itemBoxRight">{{item.sendTime}}</text>
						<text class="itemBoxRight itemBoxBold">{{item.sendUserName}}</text>
						<text class="itemBoxRight ">对我说:</text>
						<text class="itemBoxRight itemBoxBold">{{item.content}}</text>
					</view>
				
				</view>
				<view class="btnBox">
					<view class="btn">
						<u-button class="custom-style"  @click="goDetail(item)"   type="primary" size="mini">回复</u-button>
					</view>
					<view class="btn">
						<u-button class="custom-style"  @click="goRead(item)"   type="success" size="mini">已读</u-button>
					</view>
					
				</view>
				
				
			</view>

		</view>
		<pagesNoData v-else text='暂无未读消息'></pagesNoData>

	</view>
</template>

<script>
	import {
		getUnReadMessageList
	} from '@/api/platform/messageBoardController.js'
	export default {
		name: "doctorChat",
		data() {
			return {
				unReadMessageList: [],
			};
		},
		mounted() {
			this.getUnReadMessageList()
		},
		methods: {
			getUnReadMessageList() {
				getUnReadMessageList().then(res => {
					if (res.code == 200) {
						this.unReadMessageList = res.data
					}
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.pagesDoctorChat {
		.content{
			.itemBox{
			    display: flex;
			    justify-content: space-between;
			    align-items: center;
				margin: 10rpx;
				padding: 10rpx;
				box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
				border-radius: 10px;
				margin-bottom: 16rpx;
				
				.itemBoxOne{
				    margin-bottom: 10rpx;
					margin-right: 10rpx;
				}
				.itemBoxRight{
				    margin-right: 10rpx;
				}
				.itemBoxBold{
				    font-weight: bold;
				}
				.itemNoRead{
				    color: red;
				}
				.btnBox{
					.btn {
						width: 120rpx;
						margin: 30rpx auto;
					
						.custom-style {
							font-size: 30rpx;
						}
					}
				}
			
			}
		}
	}
</style>